50 CLEAR,,,32768!:SCREEN 0:KEY OFF
60 SCREEN 5:CLS:COLOR 1,11
70 PI=3.14159
80 DEF FNX(X,R,A)=X+R*SIN(A*PI/180)
90 DEF FNY(Y,R,A)=Y-R*COS(A*PI/180)
100 DIM X(212,2),Y(212,2),Z(212,2),SX(212,2),SY(212,2),SZ(212,2)
110 GOSUB 1470
120 CLS:INPUT"window (1 or 2 ) ",W
130 IF W=1 THEN WINDOW(-80,-50)-(80,50):GOTO 150
140 WINDOW(-160,-100)-(160,100)
150 INPUT"heading, pitch, bank ",H,P,B:CLS:LOCATE 1,1:PRINT USING"HDG   ####";H
160 PRINT USING"pitch ####";P:PRINT USING"bank  ####";B
170 SINH=SIN(H*PI/180):COSH=COS(H*PI/180):SINP=SIN(P*PI/180)
180 COSP=COS(P*PI/180):SINB=SIN(B*PI/180):COSB=COS(B*PI/180)
190 FOR N=1 TO 212:FOR T=1 TO 2:GOSUB 200:NEXT:NEXT:GOTO 300
200 X1=SX(N,T):Y1=SY(N,T):Z1=SZ(N,T):IF H=0 THEN 240
210 '
220 X=X1*COSH-Z1*SINH:Z=X1*SINH+Z1*COSH:X1=X:Z1=Z:IF P=0 THEN 260
230 '
240 Y=Z1*SINP+Y1*COSP:Z=Z1*COSP-Y1*SINP:Y1=Y:Z1=Z:IF B=0 THEN 280
250 '
260 X=X1*COSB-Y1*SINB:Y=X1*SINB+Y1*COSB:X1=X:Y1=Y
270 '
280 X1=X1-X1*Z1*.002:Y1=Y1-Y1*Z1*.002
290 X(N,T)=X1:Y(N,T)=Y1:Z(N,T)=Z1:RETURN
300 '
310 MK=Z(1,1):PZ=1:FOR N=2 TO 8:IF Z(N,1)<MK THEN MK=Z(N,1):PZ=N
320 NEXT
330 FOR N=1 TO 3:BEEP:FOR DELAY=1 TO 500:NEXT:NEXT
340 IF INKEY$="" THEN 330
350 ON PZ GOTO 360,370,380,390,400,410,420,430
360 T=1:GOSUB 470:T=2:GOSUB 500:GOTO 440
370 T=1:GOSUB 540:T=2:GOSUB 570:GOTO 440
380 T=2:GOSUB 540:T=1:GOSUB 570:GOTO 440
390 T=2:GOSUB 470:T=1:GOSUB 500:GOTO 440
400 T=1:GOSUB 610:T=2:GOSUB 640:GOTO 440
410 T=1:GOSUB 670:T=2:GOSUB 710:GOTO 440
420 T=2:GOSUB 670:T=1:GOSUB 710:GOTO 440
430 T=2:GOSUB 610:T=1:GOSUB 640
440 LOCATE 24,1:PRINT"press any key to redraw";
450 IF INKEY$="" THEN 450 ELSE 120
460 '
470 GOSUB 1040:GOSUB 750:GOSUB 830:GOSUB 790:GOSUB 950:GOSUB 1200
480 GOSUB 1160:GOSUB 1410:GOSUB 1120:GOSUB 1080:GOSUB 860:GOSUB 910:RETURN
490 '
500 GOSUB 750:GOSUB 1200:GOSUB 1160:GOSUB 1410:GOSUB 1280:GOSUB 1240
510 GOSUB 1040:GOSUB 1080:GOSUB 830:GOSUB 790:GOSUB 1120:GOSUB 910
520 GOSUB 860:GOSUB 1320:GOSUB 1380:RETURN
530 '
540 GOSUB 1040:GOSUB 860:GOSUB 910:GOSUB 790:GOSUB 1280:GOSUB 1240
550 GOSUB 1200:GOSUB 1160:GOSUB 1410:GOSUB 830:GOSUB 750:RETURN
560 '
570 GOSUB 1200:GOSUB 1280:GOSUB 950:GOSUB 1040:GOSUB 910:GOSUB 860
580 GOSUB 790:GOSUB 1240:GOSUB 1160:GOSUB 1410:GOSUB 830
590 GOSUB 750:GOSUB 1320:GOSUB 1380:RETURN
600 '
610 GOSUB 1380:GOSUB 1320:GOSUB 750:GOSUB 830:GOSUB 790:GOSUB 1040:GOSUB 950
620 GOSUB 1240:GOSUB 1280:GOSUB 1080:GOSUB 1120:GOSUB 860:GOSUB 910:RETURN
630 '
640 GOSUB 750:GOSUB 1160:GOSUB 1410:GOSUB 1200:GOSUB 1240:GOSUB 1280:GOSUB 830
650 GOSUB 790:GOSUB 1040:GOSUB 1080:GOSUB 1120:GOSUB 910:GOSUB 860:RETURN
660 '
670 GOSUB 1320:GOSUB 1380:GOSUB 860:GOSUB 910:GOSUB 790:GOSUB 830:GOSUB 1410
680 GOSUB 1240:GOSUB 1280:GOSUB 1040:GOSUB 1160:GOSUB 1200:GOSUB 1410
690 GOSUB 750:RETURN
700 '
710 GOSUB 910:GOSUB 860:GOSUB 790:GOSUB 830:GOSUB 1240:GOSUB 1280
720 GOSUB 1160:GOSUB 1200:GOSUB 1410:GOSUB 750:GOSUB 950:GOSUB 1040:RETURN
730 '
740 '
750 FOR C=13 TO 12 STEP -1:J=9:K=18:GOSUB 1450
760 PAINT(X(19,T),Y(19,T)),C:NEXT
770 C=8:GOSUB 1450:RETURN
780 '
790 FOR C=13 TO 12 STEP -1:J=20:K=27:GOSUB 1450
800 PAINT(X(28,T),Y(28,T)),C:NEXT
810 C=8:GOSUB 1450:RETURN
820 '
830 FOR P=29 TO 35 STEP 2:LINE(X(P,T),Y(P,T))-(X(P+1,T),Y(P+1,T)),1:NEXT
840 RETURN
850 '
860 FOR J=176 TO 212 STEP 12:PSET(X(J,T),Y(J,T)),8
870 FOR S=J-11 TO J:LINE-(X(S,T),Y(S,T)),8:NEXT
880 IF J=176 THEN PAINT(X(116,T),Y(116,T)),14,8:PSET(X(116,T),Y(116,T)),8
890 NEXT:RETURN
900 '
910 FOR S=101 TO 103:LINE(X(100,T),Y(100,T))-(X(S,T),Y(S,T)),1:NEXT
920 LINE(X(100,T),Y(100,T))-(X(104,T),Y(104,T)),1:LINE-(X(105,T),Y(105,T)),1
930 RETURN
940 '
950 FOR C=13 TO 12 STEP -1:J=37:K=46:GOSUB 1450
960 PAINT(X(47,T),Y(47,T)),C:NEXT
970 IF ABS(H-0)<10 OR ABS(H-180)<10 THEN 1020
980 LINE(X(48,T),Y(49,T))-(X(49,T),Y(49,T)),9
990 LINE(X(50,T),Y(50,T))-(X(51,T),Y(51,T)),9
1000 LINE(X(52,T),Y(52,T))-(X(53,T),Y(53,T)),15
1010 LINE(X(54,T),Y(54,T))-(X(55,T),Y(55,T)),15
1020 RETURN
1030 '
1040 FOR C=13 TO 14:J=56:K=61:GOSUB 1450:PAINT(X(62,T),Y(62,T)),C:NEXT
1050 C=6:GOSUB 1450:RETURN
1070 '
1080 FOR C=13 TO 9 STEP -4:J=63:K=66:GOSUB 1450
1090 PAINT(X(67,T),Y(67,T)),C:NEXT
1100 RETURN
1110 '
1120 FOR C=13 TO 9 STEP-4:J=68:K=70:GOSUB 1450
1130 PAINT(X(71,T),Y(71,T)),C:NEXT
1140 RETURN
1150 '
1160 FOR C=13 TO 14:J=72:K=75:GOSUB 1450
1170 PAINT(X(76,T),Y(76,T)),C:NEXT
1180 RETURN
1190 '
1200 FOR C=13 TO 14:J=77:K=79:GOSUB 1450
1210 PAINT(X(80,T),Y(80,T)),C:NEXT
1220 RETURN
1230 '
1240 FOR C=13 TO 2 STEP-11:J=81:K=84:GOSUB 1450
1250 PAINT(X(85,T),Y(85,T)),C:NEXT
1260 RETURN
1270 '
1280 FOR C=13 TO 2 STEP-11:J=86:K=89:GOSUB 1450
1290 PAINT(X(90,T),Y(90,T)),C:NEXT
1300 RETURN
1310 '
1320 N=1:PSET(X(128,N),Y(128,N)),15:FOR S=117 TO 128:LINE-(X(S,N),Y(S,N)),15
1330 NEXT:PAINT(X(99,T),Y(99,T)),7,15
1340 FOR J=140 TO 164 STEP 12:PSET(X(J,N),Y(J,N)),6
1350 FOR S=J-11 TO J:LINE-(X(S,N),Y(S,N)),6:NEXT:NEXT
1360 RETURN
1370 '
1380 FOR S=106 TO 114 STEP 2:LINE(X(S,T),Y(S,T))-(X(S+1,T),Y(S+1,T)),1:NEXT
1390 RETURN
1400 '
1410 FOR S=92 TO 97:LINE(X(91,T),Y(91,T))-(X(S,T),Y(S,T)),6:NEXT
1420 IF PZ>4 THEN RETURN
1430 FOR S=92 TO 97:LINE(X(S,T),Y(S,T))-(X(98,T),Y(98,T)),1:NEXT:RETURN
1440 '
1450 PSET(X(K,T),Y(K,T)),C:FOR S=J TO K:LINE-(X(S,T),Y(S,T)),C:NEXT:RETURN
1460 '
1470 FOR N=1 TO 116:READ SX(N,1),SY(N,1),SZ(N,1)
1480 SX(N,2)=-SX(N,1):SY(N,2)=SY(N,1):SZ(N,2)=SZ(N,1):NEXT
1490 '
1500 T=1:N=116:XC=0:YC=-1:ZP=-34
1510 FOR R=8 TO 5 STEP-1:FOR A=0 TO 330 STEP 30:N=N+1
1520 SX(N,T)=FNX(XC,R*.9,A):SY(N,T)=FNY(YR,R,A):SZ(N,T)=ZP
1530 NEXT:ZP=ZP-1:NEXT
1540 '
1550 N=164:R=4:ZC=-24:YC=-16:FOR X=10 TO 11 STEP .5
1560 FOR A=0 TO 330 STEP 30:N=N+1:SX(N,1)=X:SX(N,2)=-SX(N,1)
1570 SZ(N,1)=FNX(ZC,R,A):SZ(N,2)=SZ(N,1):SY(N,1)=FNY(YC,R,A):SY(N,2)=SY(N,1)
1580 NEXT:NEXT
1590 R=3:FOR A=0 TO 330 STEP 30:N=N+1:SX(N,1)=11:SX(N,2)=-SX(N,1)
1600 SZ(N,1)=FNX(ZC,R,A):SZ(N,2)=SZ(N,1):SY(N,1)=FNY(YC,R,A):SY(N,2)=SY(N,1)
1610 NEXT:RETURN
1620 '
1630 DATA -30,-30,-30,-30,30,-30,30,30,-30,30,-30,-30
1640 DATA -30,-30,30,-30,30,30,30,30,30,30,-30,30
1650 '
1660 DATA 0,15,-31,48,15,-31,53,15,-28,56,15,-19,56,15,-16,55,15,-14
1670 DATA 52,15,-13,6,15,-13,4,15,-16,0,15,-17,26,15,-22
1680 '
1690 DATA 6,-7,-25,48,-2.5,-25,53,-2,-22,56,-2,-13,56,-2,-10
1700 DATA 55,-2,-8,52,-2.2,-7,6,-7,-7,26,-5,-16
1710 '
1720 DATA 40,14,-28,40,-3,-23,40,14,-21,40,-2,-16,10,14,-27,5,6,-29
1730 DATA 10,14,-20,5,6,-18
1740 '
1750 DATA 0,4,22,0,7,21,0,10,23,0,11,30,0,9,35,0,6,36,0,3,36,0,-1,34
1760 DATA 0,-3,31,0,3,31,0,8,29
1770 '
1780 DATA 0,10,31,0,-3,31,0,10,32,0,-3,32,0,9,33,0,-2,33,0,9,34,0,-1,34
1790 '
1800 DATA 2,3,23,14,3,23,16,2.5,30,12,2,35,6,2,35,1,2.5,30,9,2.5,29
1810 '
1820 '
1830 DATA 0,-8,-34,6,-8,-34,6,-8,-12,0,-8,-12,3,-8,-23
1840 '
1850 DATA 6,-8,-12,0,-3,30,0,-8,-12,3,-7,-4
1860 '
1870 DATA 6,6,-12,0,6,-12,0,6,-34,6,6,-34,3,6,-23
1880 '
1890 DATA 6,6,-12,0,2,30,0,6,-14,3,5,-7
1900 '
1910 DATA 6,-8,-34,6,5,-34,6,5,-12,6,-8,-12,6,-1.5,-23
1920 '
1930 DATA 6,-8,-12,6,5,-12,0,2,30,0,-3,30,4.7,-1,-4
1940 '
1950 DATA 0,4,10,0,8,-12,.5,8,-12,1,7.5,-12,2,7,-12,2.5,6.5,-12,3,6,-12,0,6,-12
1960 '
1970 DATA 0,-1,-34
1980 '
1990 DATA 9,-16,-24,6,-6.5,-29,6,-6.5,-17,0,-16,-24,0,-10,-24,6,-6.5,-24
2000 '
2010 DATA 0,-1,-38,0,-1,-41,0,0,-38,0,0,-40,0,-2,-38,0,-2,-40
2020 DATA 1,-1,-38,1,-1,-40,-1,-1,-38,-1,-1,-40
2030 '
2040 DATA 10,-16,-24
